<style>
.queue{margin-top:20px;}
.queue .queue_list{float:left; position:relative; width:150px; height:150px; border-radius:100%; margin:0 20px 20px 0; color:#FFF;}
.queue .queue_list .name{width:150px; height:40px; line-height:40px; text-align:center; font-size:20px; font-weight:bold;}
.queue .queue_list .status{width:150px; height:25px; line-height:25px; text-align:center; font-size:16px;}
.queue .queue_list .button{position:absolute; display:none; top:0px; right:0px; width:35px; height:35px; text-align:center; line-height:35px; font-size:22px; border-radius:40px; background:rgba(0,0,0,.3);}
.queue .queue_list:hover .button{display:block;}
.queue .queue_list:hover .button:hover{background:#000}
</style>
<div class="panel-body">
		<div class="alert alert-warning">
			显示当前所有可用队列，当前订单人数，当前排号情况等。<br>
		</div>
		<div class="alert alert-warning">
			【叫号语音】：没语音?语音不自定义？移步：门店列表--门店设置--语音设置<a class="color" href="javascript:" ng-click="access_json('jy_weishop/store.setting/');">jy_weishop/store.setting/</a><br>
		</div>
		<div class="queue" ng-if="pagedata.op=='user'">
			<div ng-repeat="item in pagedata.list" class="queue_list t-c block-{{item.showcolor}}">
				<div class="name">{{item.title}}</div>
				<div class="status">当前：{{item.nowmember || '000'}}</div>
				<div class="status">等待：{{item.queue_num || '0'}}位</div>
				<div class="status">剩余：{{item.lasttablenum || '0'}}桌</div>
				<a ng-if="item.queue_num > 0" class="status" href="javascript:" ng-click="pagedata.call(item.id);"><span class="jylabel jylabel-red">叫号</span></a>
				<a ng-if="item.nowmember" class="status" href="javascript:" ng-click="pagedata.replaycall(item.nowmember);"><span class="jylabel jylabel-red">重叫</span></a>
			</div>
			<div  ng-if="pagedata.list.length <1" class="page-header" style="text-align: center;">
					<i class="fa fa-meh-o" style="font-size:88px"></i>
					<h1 class="ng-binding">暂时还没有添加队列！</h1>
			</div>
		</div>
</div>
<script>
scope.pagedata.call=function(id){
	scope.get('/store.s_item.s_queue/call/queue_id='+id,function(res){
		console.log(res);
		if(res.success){
			if(res.speech){
				var audiobase64=res.speech;
				var snd = new Audio("data:audio/wav;base64," + audiobase64);
				snd.play();
			}
			scope.message('叫号成功！');
		}else{
			scope.message('叫号失败！');
		}
		
		
	})
}
scope.pagedata.replaycall=function(number){
	scope.get('/store.s_item.s_queue/replaycall/number='+number,function(res){
		console.log(res);
		if(res.success){
			if(res.speech){
				var audiobase64=res.speech;
				var snd = new Audio("data:audio/wav;base64," + audiobase64);
				snd.play();
			}
			scope.message('重新叫号成功！');
		}else{
			scope.message('重新叫号失败！');
		}
		
		
	})
}
</script>